<?php
// ----- >> Extends From Template
class thisPDF extends PDF{
	function Header(){}
	function Footer(){}
}


// ----- >> Init
$fpdf = new thisPDF('P','mm','A4');
$fpdf->AddPage();
$fpdf->SetLeftMargin(8);

$fpdf->Ln(0);
$ln_header_y_top	= $fpdf->GetY();

$time = date('d-M-y');

// ----- >> Header
//$Image = APPPATH . 'file/kstore/logo_primkokas.jpg' ; 
$fpdf->Cell( 40, 40, $fpdf->Image(APPPATH . 'file/kstore/logo_primkokas.jpg' , $fpdf->GetX(), $fpdf->GetY(), 33.78), 0, 0, 'L', false );
$fpdf->Ln(20);

$fpdf->Ln(2);
$fpdf->SetFont('Arial','B',14);
$fpdf->Cell(0,4,"Permintaan Pembayaran",0,0,'L');
$fpdf->Ln(15);
$fpdf->Line(9, 30, 200-3, 30); // 197mm from each edge

// ----- >> Data Master
$fpdf->Ln(7);

$fpdf->SetFont('Arial','',10);
$fpdf->Cell(42,5,"No Pembayaran",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(50,5,$data['no_pembayaran'],0,0,'L');
$fpdf->Ln(4);

$fpdf->SetFont('Arial','',10);
$fpdf->Cell(42,5,"Tanggal Pembayaran",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(20,5,$data['tanggal_bayar'],0,0,'L');
$fpdf->Ln(4);

$fpdf->Cell(42,5,"Keretangan/Uraian",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(40,5,$data['keterangan_uraian'],0,0,'L');
$fpdf->Ln(4);

$num = $data['banyak_satuan'] ;
$formattedNum = number_format($num);

$fpdf->Cell(42,5,"Banyak satuan",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(20,5,$num,0,0,'L');
$fpdf->Ln(4);

$num1 = $data['harga_satuan'] ;
$formattedNum1 = number_format($num1);

$fpdf->Cell(42,5,"Harga Satuan",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(20,5,"Rp. ".$num1.",-",0,0,'L');
$fpdf->Ln(4);

$num2 = $data['total'] ;
$formattedNum2 = number_format($num2);

$fpdf->SetFont('Arial','',10);
$fpdf->Cell(42,5,"Total",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(60,5,"Rp. ".$num2.",-",0,0,'L');
$fpdf->Ln(4);

$fpdf->Cell(42,5,"Terbilang",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(20,5,"# Rp. ".$data['terbilang']."#",0,0,'L');
$fpdf->Ln(20);

$fpdf->SetFont('Arial','',10);
$fpdf->Cell(155,5,"",0,0,'L');
$fpdf->Cell(10,5,"Cilegon, ".$time,0,0,'R');
$fpdf->Ln(7);

$fpdf->Cell(35,5,"",0,0,'L');
$fpdf->Cell(87,5,"Mengetahui ",0,0,'L');
$fpdf->SetFont('Arial','B',10);
$fpdf->Cell(10,5,"PRIMER KOPERASI KARYAWAN ",0,0,'L');
$fpdf->Ln(5);
$fpdf->Cell(133,5,"",0,0,'L');
$fpdf->Cell(10,5,"KRAKATAU STEEL",0,0,'L');
$fpdf->SetFont('');
$fpdf->Ln(25);


//$fpdf->Image(APPPATH . 'file/media/ttd_isp.jpg');
//$fpdf->Ln(5);
$fpdf->Cell(34,5,"",0,0,'L');
$fpdf->SetFont('Arial','BU',10);
$fpdf->Cell(108,5,"Aan Supriana",0,0,'L');
$fpdf->Cell(10,5,"Ngajito",0,0,'L');
$fpdf->Ln(5);
$fpdf->Cell(15,5,"",0,0,'L');
$fpdf->SetFont('');
$fpdf->Cell(123,5,"Internal Busines & Property Div. Manager",0,0,'L');
$fpdf->Cell(10,5,"Property Div.",0,0,'L');
$fpdf->Ln(5);


/*$fpdf->Cell(42,5,"Keterangan",0,0,'L');
$fpdf->Cell(2,5,":",0,0,'L');
$fpdf->Cell(20,5,$data['keterangan'],0,0,'L');
$fpdf->Ln(4);
*/


echo $fpdf->Output('CetakSample.pdf', 'I');
exit();
?>
<!-- 

 -->